package com.itheima.case2.serviceimp;

import com.itheima.case2.dao.RoleMapper;
import com.itheima.case2.dao.UserMapper;
import com.itheima.case2.pojo.Role;
import com.itheima.case2.pojo.User;
import com.itheima.case2.serviceiterface.RoleService;
import com.itheima.case2.serviceiterface.UserService;
import com.itheima.case2.utils.SqlSessionUtil;
import com.itheima.case2.vo.PageBean;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class RoleServiceImpl implements RoleService {

    @Override
    public List<Role> findAllRoles() {

        //mybatis那一套
        //使用代理对象的方式实现
        RoleMapper roleMapper = SqlSessionUtil.getProxyMapper(RoleMapper.class);
        //调用查询所有角色的方法
        List<Role> list = roleMapper.findAllRoles();
        //将list集合返回给web层
        return list;

    }
}
